package com.xjh.mange.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xjh.mange.mapper.LogMapper;
import com.xjh.mange.model.Log;
import com.xjh.mange.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @author 徐佳辉
 * @date 2020/12/20 14:58
 */
@Service
public class LogServiceImpl extends ServiceImpl<LogMapper, Log> implements LogService {

    @Autowired
    private LogMapper logMapper;

    @Override
    public void Log(String username, String operation) {
        Log log = new Log();
        log.setCreateTime(new Date());
        log.setOperation(operation);
        log.setUserName(username);
        logMapper.insert(log);
    }
}
